import  string
def numToIP(num):
    ip=[]
    for i in range(3,-1,-1):
        sec = num>>(8*i)&0xff
        ip.append(str(sec))
        if i!=0:
            ip.append('.')
    return string.join(ip,'')

def ipToNum(ip):
    num=0L
    ipsec = string.split(ip,'.')
    for i in range(3,-1,-1):
        j = 3 - i
        num = num + (int(ipsec[j])<<(8*i))
    return num

print numToIP(167773121)
print ipToNum('10.0.3.193')

